﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>{{ title }}</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <link rel="stylesheet" href="home.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
    <style>
        #results {
            padding-top: 25px;
            padding-bottom: 25px;
        }

        #body {
            background-image: url(../static/home_images/ai-background_62139.png);
            background-size: cover;
        }
        #return-home.btn,
        #upload-button.btn {
            outline-color: black;
            color: white;
            background-color: rgb(0, 110, 150);
        }
        #return-home.btn:hover,
        #upload-button.btn:hover {
            background-color: rgb(0, 110, 230);
        }
    </style>
</head>
<body>
    <header>
        <div class="collapse bg-dark" id="navbarHeader">
            <div class="container">
                <div class="row">
                    <div class="col-sm-8 col-md-7 py-4">
                        <h4 class="text-white">About</h4>
                        <p class="text-white">
                            I am Daniel Silva, a Computer Science and Statistics student at the University of Central Florida.
                            I'll write more about myself later.
                        </p>
                    </div>
                    <div class="col-sm-4 offset-md-1 py-4">
                        <h4 class="text-white">Contact</h4>
                        <ul class="list-unstyled">
                            <li><a href="#" class="text-white">Visit my portfolio</a></li>
                            <li><a href="https://www.linkedin.com/in/danielsilva98" class="text-white">Connect with me on LinkedIn</a></li>
                            <li><a href="danielzgsilva@knights.ucf.edu" class="text-white">Email me</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="navbar navbar-dark bg-dark box-shadow">
            <div class="container d-flex justify-content-between">
                <a href="#" class="navbar-brand d-flex align-items-left">
                    <strong>Daniel Silva's Facial Classifier</strong>
                </a>
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
            </div>
        </div>
    </header>

    <main role="main">
        <div class="jumbotron jumbotron-fluid text-center" style="background-color: white" id="results">
            <h1 class="jumbotron-heading">Invalid File Selection</h1>
            <p class="lead">
                Oops! You did not upload a valid file to the classifier. <br />
                Please upload a JPG or PNG below and let us try again!
            <p /><br />
            <form id="upload-form" action="{{ url_for('upload') }}" value="Choose Your File!" method="POST" enctype="multipart/form-data">
                <p>
                    <input id="file-picker" class="btn btn-outline-secondary" type="file" name="file" accept="image/*" single />
                    <input type="submit" class="btn" value="Run the face classifier" id="upload-button" />
                </p>
            </form>
        </div>
        <div class="container-fluid text-center" id="body"><br />
            <div class="row justify-content-center">
                <div class="card border-secondary mb-4 box-shadow">
                    <img src="{{url_for('load_home', filename=example)}}" class="rounded"><br />
                    <div class="card-body">
                        <p class="card-text">The classifier is unable to interpret this file type</p>
                        <div class="d-flex justify-content-between align-items-center">
                            <div class="btn-group">
                                <form id="return-home" action="{{ url_for('index') }}">
                                    <input type="submit" class="btn" value="Return home" id="return-home">
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
    </main>

    <footer class="text-muted">
        <div style="background-color: white">
            <div class="container">
                <br />
                <p class="float-right">
                    <a href="#">Back to top</a>
                </p>
                <p class="float-left">Daniel Silva's Facial Classifier</p>
            </div>
        </div>
    </footer>
</body>
</html>
<script>
    $("#file-picker").change(function () {
        var input = document.getElementById('file-picker');
        for (var i = 0; i < input.files.length; i++) {
            var ext = input.files[i].name.substring(input.files[i].name.lastIndexOf('.') + 1).toLowerCase()
            if ((ext == 'jpg') || (ext == 'png') || (ext == 'jpeg')) {
                $("#msg").text("Your file is supported.")
            }
            else {
                $("#msg").text("File was NOT supported. Please upload either a JPG or PNG file.")
                document.getElementById("file-picker").value = "";
            }
        }
    });
</script>
